package com.lx.patterns.prototype.demo3;

import java.io.*;

/**
 * @ClassName Client
 * @Description: //todo
 * @Author: 落雪
 * @CreateDate: 2025/1/15 07:29
 * @UpdateUser: 落雪
 * @UpdateDate: 2025/1/15 07:29
 * @UpdateRemark:
 * @Version: 1.0
 */
public class Client {

    public static void main(String[] args) throws Exception {
        Citation citation = new Citation();


        ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("/Users/luoxue/test/1.txt"));
        out.writeObject(citation);

        ObjectInputStream ins = new ObjectInputStream(new FileInputStream("/Users/luoxue/test/1.txt"));
        Citation clone = (Citation)ins.readObject();

        Student stu1 = new Student();
        stu1.setName("小红");
        citation.setStudent(stu1);

        Student stu2 = new Student();
        stu2.setName("小明");
        clone.setStudent(stu2);



        citation.show();
        clone.show();

    }
}
